<?php require RCMS_Object_QuickConfig_QuickConfig::PATH_HEADER; ?>
<?php $this->headLink()->appendStylesheet($this->websiteUrl . 'system/css/seotoaster.css'); ?>
<?php $this->headLink()->appendStylesheet($this->websiteUrl . 'system/css/datepicker/datepicker.css'); ?>
<?php $this->headLink()->appendStylesheet($this->websiteUrl . 'system/js/thickbox/thickbox.css'); ?>
<?php echo $this->headLink(); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/jquery/jquery.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/thickbox/thickbox.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/jquery/plugins/core.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/jquery/plugins/datepicker.js'); ?>
<?php //$this->headScript()->appendFile($this->websiteUrl . 'system/js/tiny_mce/tiny_mce_gzip.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/tiny_mce/tiny_mce.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/tiny_mce/jquery.tinymce.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/system.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/blog/blog.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/wheel/wheel.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/shoppingforcontent/shoppingforcontent.js'); ?>
<?php echo $this->headScript(); ?>
<!--<script type="text/javascript">tinyMCE_GZ.init({plugins : 'safari,preview,spellchecker,media',	themes : 'simple,advanced',	languages : 'en', disk_cache : true, debug : false});</script>-->
<script type="text/javascript">	
function toggleEditor(id)
{
    if (!tinyMCE.getInstanceById(id)) {
        tinyMCE.execCommand('mceAddControl', false, id);
    } else {
        tinyMCE.execCommand('mceRemoveControl', false, id);
    }
 }

	$(document).ready(function(){
        Sc.init({websiteurl:'<?php echo $this->websiteUrl; ?>'});
        Sc.tabForContent();
        // for blog
        if ($('#blog').val() == 1) {
            $('#applyblog').attr('checked', true);
        } else {
            $('#applyblog').attr('checked', false);
        }
        $('#applyblog').click(function() {
            if($('#applyblog').attr('checked')) {
                $('#blog').val(1);
                insertHeaderForBlog();
            } else {
                $('#blog').val(0);
            }
        });
		// Creates a new plugin class and a custom listbox
		tinymce.create('tinymce.plugins.ExamplePlugin', {
			createControl: function(n, cm) {
				switch (n) {
					case 'variables':
						var mlb = cm.createListBox('variables', {
							title : 'Widgets',
							onselect : function(v) { $('textarea.tinymce').tinymce().execCommand('mceInsertContent',false, v); }
						});

						// Add some values to the list box
						mlb.add('{$page_title}', '{$page_title}');
						mlb.add('{$page_h1}', '{$page_h1}');
						mlb.add('{$concatcss}', '{$concatcss}');
						mlb.add('{$cart}', '{$cart}');
						mlb.add('{$main_menu}', '{$main_menu}');
						//mlb.add('{$main_menu_jq}', '{$main_menu_jq}');
                        mlb.add('{$main_menu_img}', '{$main_menu_img}');
                        mlb.add('{$main_menu_featured:your title here}', '{$main_menu_featured:your title here}');
						mlb.add('{$static_menu}', '{$static_menu}');
						mlb.add('{$member_login}', '{$member_login}');
						mlb.add('{$member_logout}', '{$member_logout}');
						mlb.add('{$pages_list}', '{$pages_list}');
						mlb.add('{$categories_list}', '{$categories_list}');
						mlb.add('{$categories_list_img}', '{$categories_list_img}');
						mlb.add('{$sitemap}', '{$sitemap}');
						mlb.add('{$pages_list_img}', '{$pages_list_img}');
						mlb.add('{$category_name}', '{$category_name}');
						mlb.add('{$website_url}', '{$website_url}');
						mlb.add('{$newsscroller}', '{$newsscroller}');
						mlb.add('{$search_result}', '{$search_result}');
						mlb.add('{$search_result_img}', '{$search_result_img}');
						mlb.add('{$social_bookmarks_block}','{$social_bookmarks_block}');
						mlb.add('{$product_brands}','{$product_brands}');
						mlb.add('{$product_categories}','{$product_categories}');
						//get additional variables
						jQuery.ajax({
							type: "get",
							url: '<?php echo $this->websiteUrl; ?>sys/backend_ajax/getvars',
							success: function(response) {
								if(response !== 'no_vars') {
									var varNames = eval('(' + response + ')')
									for(var i=0; i<=(varNames.length - 1); i++) {
										mlb.add('{$' + varNames[i] + '}', '{$' + varNames[i] + '}');
										if(varNames[i] == 'rssfeed:all'){
											mlb.add('{$news_aggregator_block}','{$news_aggregator_block}');
										}
									}
								}
							}
						});
						// Return the new listbox instance
						return mlb; }
					return null; }
			
			});
			
			// Register plugin with a short name
			tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
			$('textarea.tinymce').tinymce({
				script_url : '<?php echo $this->websiteUrl; ?>system/js/tiny_mce/tiny_mce.js',
				mode: "exact",
				elements : "admincontentarea",
				width: 620,
				height: 506,
				theme : "advanced",
				convert_urls: 0,
                entity_encoding : "raw",
				apply_source_formatting: true,
                plugins : "safari,preview,spellchecker,fullscreen,media,paste,example",
				paste_auto_cleanup_on_paste : true,
				paste_remove_styles: true,
		
				
		paste_preprocess : function(pl, o) {
            // Content string containing the HTML from the clipboard
			// used to remove some bad html BEFORE we paste it.          
        },
        paste_postprocess : function(pl, o) {
            // Content DOM node containing the DOM structure of the clipboard
           // To do some stuff AFTER it hasw been cleaned.
        },
				content_css: "<?php echo $this->websiteUrl; ?>themes/<?php echo $this->currTheme; ?>/content.css",
				theme_advanced_buttons1 : "bold,italic,underline,|,"
					+"justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,formatselect,styleselect,fontsizeselect,forecolor,|,"
					+"link,unlink,anchor,hr",
				theme_advanced_buttons2 : "pastetext,charmap,image,media,|,variables,|,fullscreen,preview,spellchecker,|,undo,redo,|,removeformat,cleanup,code",
				theme_advanced_buttons3 : "",
				spellchecker_languages : "+English=en,French=fr,German=de,Hebrew=iw,Italian=it,Polish=pl,Portuguese (Brazil)=pt-BR,"
					+"Portuguese (Portugal)=pt-PT,Russian=ru,Spanish=es,Ukrainian=uk",
				spellchecker_rpc_url: '<?php echo $this->websiteUrl; ?>system/js/tiny_mce/plugins/spellchecker/rpc.php',
				theme_advanced_blockformats: "p,address,pre,h2,h3,h4,h5,h6,blockquote,div",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				extended_valid_elements : "iframe[width|height|frameborder|scrolling|marginheight|marginwidth|src]",
				external_link_list_url : "<?php echo $this->websiteUrl; ?>system/js/tiny_mce/link_list.js",
				media_external_list_url: "<?php echo $this->websiteUrl; ?>system/js/tiny_mce/medialist.js" });
		});
		$(function() {
            $('#datepicker').datepicker({ dateFormat: 'mm-dd-yy' }); $("#datepicker").datepicker();
            $('#blog-posts-from-date').datepicker({ dateFormat: 'yy-mm-dd', onSelect: function() { $('#blog-posts-from-date').css("background-color", "#fff");} });
            $('#blog-posts-to-date').datepicker({ dateFormat: 'yy-mm-dd', onSelect: function() { $('#blog-posts-to-date').css("background-color", "#fff");} });
        });
</script>
<div id="seotoaster" class="inspired" style="display:none;">
	<div id="ajaxBusy" class="success" style="display:none;">Querying Google wheel. Please wait...</div>
	<div class="close_window" onclick="backToPage();"></div>
	<div id="inspired-errors" class="errors"  style="display:none;cursor:pointer;">
		<ul>
			<li id="search-empty" style="display:none;"><strong>Search field can't be empty.</strong></li>
		</ul>
	</div>
	<div id="admineditwhat">{%Get Inspired%}</div>
	<p>
		<?php echo $this->inspiredForm; ?>
	</p>
	<div class="words-list"></div>
</div>
<div id="seotoaster" class="editor">
	<div id="ajaxcontentmsg" class="success" style="display: none;"></div>
	<div class="admineditwhat"> </div>
	<div class="close_window" onclick="parent.tb_remove();"></div>
	<?php echo $this->form; ?>
	<div id="selector">
		<div id="borderfortoolbar">
			<!--  right toolbar -->
			<div id="adminthingsviewer">
				<!-- small images -->
				<div id="small" class="button" onclick="showDiv(this.id);">{%Small%} <span>(<?php echo $this->widthSmallImg; ?>px)</span></div>
				<div id="images_small" class="hide"></div>
				<!-- end small images -->
				<!-- medium images -->
				<div id="medium" class="button" onclick="showDiv(this.id);">{%Medium%} <span>(<?php echo $this->widthMediumImg; ?>px)</span></div>
				<div id="images_medium" class="hide"></div>
				<!-- end medium images -->
				<!-- large images -->
				<div id="large" class="button" onclick="showDiv(this.id);">{%Large%} <span>(<?php echo $this->widthLargeImg; ?>px)</span></div>
				<div id="images_large" class="hide"></div>
				<!-- end large images -->
				<!--  video -->
				<div id="original" class="button" onclick="showDiv(this.id);">{%Original%}</div>
				<div id="images_original" class="hide"></div>
				<!-- end video -->
				<!-- list files -->
				<div id="files" class="button" onclick="showDiv(this.id);">{%Files%}</div>
				<div id="list_files" class="hide">
					<?php if(!empty($this->downloadFiles ) && is_array($this->downloadFiles )): ?>
						<?php foreach ($this->downloadFiles as $fileName): ?>
								<?php if($this->protected): ?>
									<p><a href="javascript:;" title="<?php echo ToolsHelper::cropType($fileName); ?>" onmousedown="$('#admincontentarea').tinymce().execCommand('mceInsertContent',false, '<a href=\'<?php echo $this->websiteUrl . 'sys/backend_things/downloadfile/file/' . RCMS_Tools_Tools::cryptString($this->currentPageId .'.'. $fileName); ?>\' title=\'<?php echo ToolsHelper::cropType($fileName); ?>\'><?php echo $fileName; ?></a>');"><?php echo $fileName; ?></a></p>
								<?php else: ?>
									<p><a href="javascript:;" title="<?php echo ToolsHelper::cropType($fileName); ?>" onmousedown="$('#admincontentarea').tinymce().execCommand('mceInsertContent',false, '<a href=\'<?php echo $this->websiteUrl . 'downloads/' . $fileName; ?>\' title=\'<?php echo ToolsHelper::cropType($fileName); ?>\'><?php echo $fileName; ?></a>');"><?php echo $fileName; ?></a></p>
								<?php endif; ?>
						<?php endforeach; ?>
					<?php endif; ?>
				</div>
				<!-- end list files -->
				<!--  widgets maker and related -->
				<div id="variables_maker" class="button" onclick="showDiv(this.id);">{%Widgets Maker%}</div>
				<div id="content_variables_maker" class="hide">
					<!-- featured areas -->
					<h3>{%Featured Areas%}</h3>
					<form action="javascript:;" onsubmit="insertFeaturedAreasInContent(this);">
						<p align="left" style="margin-top:10px;"><span>{%select%} </span>
							<select name="list_featured_areas" id="list_featured_areas">
								<?php if(!empty($this->fa) && is_array($this->fa)): ?>
									<?php foreach($this->fa as $fa): ?>
								<option value="<?php echo $fa; ?>"><?php echo $fa; ?></option>
									<?php endforeach; ?>
								<?php endif; ?>
							</select></p>
						<p align="left" style="padding:5px 0px 5px 0px;">
							<span style="margin-right:25px;">{%max results:%}</span>
							<input type="text" style="width:30px;" name="featured_areas_max" id="featured_areas_max" value="4" onfocus="this.select();" />
						</p>
						<p align="left" style="padding:5px 0px 5px 0px;">
							<span>{%max characters:%} </span>
							<input type="text" style="width:30px;" name="featured_areas_max_characters" id="featured_areas_max_characters" value="200" onfocus="this.select();" />
						</p>
						<p align="left" style="padding:5px 0px 5px 0px;">
							<span> {%use image?%}</span>
							<input type="checkbox" name="featured_areas_img" id="featured_areas_img" />
							<span> {%random?%}</span>
							<input type="checkbox" name="featured_areas_random" id="featured_areas_random" />
						</p>

						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
					<!-- end featured areas -->
                                        <!-- featured page -->
                                        <hr class="hrseparate" />
                                        <h3>{%Feature a Page%}</h3>
                                        <form action="javascript:;" onsubmit="insertFeaturedPageInContent(this);">
                                                <p align="left" style="margin-top:10px;"><span>{%select%} </span>
                                                        <select name="list_featured_pages" id="list_featured_pages">
								<?php if(!empty($this->fp) && is_array($this->fp)): ?>
									<?php foreach($this->fp as $fp): ?>
								<option value="<?php echo $fp['id']; ?>"><?php echo $fp['nav_name']; ?></option>
									<?php endforeach; ?>
								<?php endif; ?>
							</select>
                                                </p>
                                                <p align="left" style="padding:5px 0px 5px 0px;">
							<span>{%max characters:%} </span>
							<input type="text" style="width:30px;" name="featured_page_max_characters" id="featured_page_max_characters" value="200" onfocus="this.select();" />
						</p>
                                                <p align="left" style="padding:5px 0px 5px 0px;">
							<span> {%use image?%}</span>
							<input type="checkbox" name="featured_page_img" id="featured_page_img" />
                                                </p>
                                                <input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
                                        </form>
                                        <!-- end featured page -->
					<!-- related -->
					<hr class="hrseparate" />
					<h3>{%Related Pages List%}</h3>
					<form action="javascript:;" onsubmit="insertRelatedInContent(this);">
						<p align="left"><span>{%relevance:%} </span>
							<input type="text" style="width:30px;" name="related_count_keywords" id="related_count_keywords"/>
							<span> {%keywords.%}</span></p>
						<p align="left" style="margin-top:5px;">
							<span>{%max results:%} </span><input type="text" style="width:30px;" name="related_max" id="related_max" value="" />
							<input type="checkbox" name="related_img" id="related_img" /><span> {%use image?%}</span></p>
						<input type="submit" class="submitform" value="Apply" />
						<div style="clear:both;"></div>
					</form>
					<!-- end related -->

                    <!-- new gallery -->
                    <hr class="hrseparate" />
					<h3>{%Image Gallery%}</h3>
                    <form action="javascript:;" onsubmit="insertVariableGallery();">
                        <p align="left" style="margin-top:10px;">
							<select name="gallery-list-folder" id="gallery-list-folder">
								<option value="" selected="selected">{%select folder%}</option>
								<?php if(count($this->listFolders) > 0 && is_array($this->listFolders)): ?>
								<?php foreach($this->listFolders as $gallery): ?>
								<option value="<?php echo $gallery; ?>"><?php echo $gallery; ?></option>
								<?php endforeach; ?>
								<?php endif; ?>
							</select>
                        </p>
                        <p align="left" style="margin-top:5px;"><span>{%images thumbnails size:%}</span>
                            <input type="text" style="width:40px;" id="gallery-thumbnails-size" name="gallery-thumbnails-size" value="" />
                        </p>
                        <p style="margin-top:5px;">
                            <input type="checkbox" name="gallery-crop" id="gallery-crop" /><span> {%crop image?%}</span>
                            <input type="checkbox" style="margin-left:10px;" name="gallery-caption" id="gallery-caption" /><span> {%caption?%}</span>
                        </p>
                        <p align="left" style="margin-top:5px;">
                            <input type="checkbox" name="gallery-cooliris" id="gallery-cooliris" onclick="if(this.checked){$('#use-cooliris-for-gallery').show();}else{$('#use-cooliris-for-gallery').hide();}"/><span> {%use cooliris?%}</span>
                        </p>
                        <div id="use-cooliris-for-gallery" style="display:none;">
                        <p align="left" style="margin-top:5px;">
                            <span>{%Size%}:</span> <input type="text" style="width:50px" name="gallery-cooliris-width" id="gallery-cooliris-width" value="" />
                            <span>&nbsp;x&nbsp;</span><input type="text" style="width:50px" name="gallery-cooliris-height" id="gallery-cooliris-height" value="" />
                        </p>
                        <p align="left" style="margin-top:5px;">
                            <span>{%Style%}:</span>
                            <select name="gallery-style" id="gallery-style" style="width:70px;">
                                <option value="white">{%white%}</option>
                                <option value="black" selected="selected">{%black%}</option>
                                <option value="light">{%light%}</option>
                                <option value="dark">{%dark%}</option>
                            </select>&nbsp;
                            <span>{%Rows%}:</span>
                            <select name="gallery-rows" id="gallery-rows" style="width:50px;">
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3" selected="selected">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                            </select>
                        </p>
                        </div>
                        <input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
                    </form>
                    <!-- end new gallery -->

					<!-- old gallery
					<hr class="hrseparate" />
					<h3>{%Image Gallery%}</h3>
					<form action="javascript:;" onsubmit="insertGallery(this, '<?php echo $this->websiteUrl; ?>');">
						<p align="left" style="margin-top:10px;"><span>{%new gallery:%} </span><input type="text" style="width:100px;" id="gallery_name" name="gallery_name" value="" onkeyup="if(this.value != ''){this.form.list_galleries.disabled='disabled';}else{this.form.list_galleries.disabled='';}" /></p>
						<p align="left" style="margin-top:10px;"><span>{%or%} </span>
							<select name="list_galleries" id="list_galleries" onchange="loadSettingsForGallery(this.options[this.selectedIndex].value, this.form, '<?php echo $this->websiteUrl; ?>');">
								<option value="" selected="selected">{%select gallery%}</option>
								<?php if(!empty($this->galleries) && is_array($this->galleries)): ?>
									<?php foreach($this->galleries as $gallery): ?>
								<option value="<?php echo $gallery; ?>"><?php echo $gallery; ?></option>
									<?php endforeach; ?>
								<?php endif; ?>
							</select></p>
						<p style="margin-top:5px;">&nbsp;<input type="checkbox" name="gallery_lightbox" id="gallery_lightbox" /><span>  {%use lightbox?%}</span></p>
						<p align="left" style="margin-top:5px;"><span>{%images thumbnails size:%}</span><input type="text" style="width:30px;" id="gallery_thumbnails" name="gallery_thumbnails" value="" /></p>
						<p style="margin-top:5px;">&nbsp;<input type="checkbox" name="gallery_crop" id="gallery_crop" /><span> {%crop image?%}</span>
							<input type="checkbox" style="margin-left:10px;" name="gallery_caption" id="gallery_caption" /><span> {%caption?%}</span></p>
						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
					end old gallery -->
                    
                    <!-- Cooliris Wall 
                    <hr class="hrseparate" />
					<h3>{%Cooliris Wall%}</h3>
					<form action="javascript:;" onsubmit="insertCoolirisWall(this);">
						<p align="left" style="margin-top:10px;">
                            <select name="list_galleries_for_wall" id="list_galleries_for_wall">
                                <option value="" selected="selected">{%select folder%}</option>
								<?php if(count($this->listFolders) > 0 && is_array($this->listFolders)): ?>
								<?php foreach($this->listFolders as $gallery): ?>
								<option value="<?php echo $gallery; ?>"><?php echo $gallery; ?></option>
								<?php endforeach; ?>
								<?php endif; ?>
                            </select>
                        </p>
                        <p style="margin-top:5px;">
                            <span>{%Size%}</span><input type="text" style="width:50px" name="cooliris_wall_width" id="cooliris_wall_width"/>
                            <span>&nbsp;x&nbsp;</span><input type="text" style="width:50px" name="cooliris_wall_height" id="cooliris_wall_height" />
                        </p>
                        <p style="margin-top:5px;">
                            <span>{%Rows%}</span>
                            <select name="cooliris_wall_rows" id="cooliris_wall_rows">
                                <option value="" selected="selected">{%select%}</option>
                                <option value="1" >1</option>
                                <option value="2" >2</option>
                                <option value="3" >3</option>
                                <option value="4" >4</option>
                                <option value="5" >5</option>
                                <option value="6" >6</option>
                                <option value="7" >7</option>
                            </select>
                        </p>
                        <p style="margin-top:5px;">
                            <span>{%Style%}</span>
                            <select name="cooliris_wall_style" id="cooliris_wall_style">
                                <option value="" selected="selected">{%select%}</option>
                                <option value="white">{%white%}</option>
                                <option value="black">{%black%}</option>
                                <option value="light">{%light%}</option>
                                <option value="dark">{%dark%}</option>
                            </select>
                        </p>
						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
                                        end Cooliris Wall -->
					<!-- payment button -->
					<!--
					<hr class="hrseparate" />
					<h3>{%Payment Button%}</h3>
					<form action="javascript:;" onsubmit="insertPaymentButtonInContent(this, '<?php echo $this->websiteUrl; ?>');">
					<p align="left" style="margin-top:10px;"><span>{%new:%}</span> <input type="text" style="width:120px;" id="payment_name" name="payment_name" value="" /></p>
					<p align="left" style="margin-top:10px;"><span>{%or%} </span>
					<select name="list_payment" style="width:170px;" id="list_payment" onchange="loadContentForPaymentButton(this ,'<?php echo $this->websiteUrl; ?>');">
						<option value="" selected="selected">{%select payment button%}</option>
					<?php if(!empty($this->variables) && is_array($this->variables)): ?>
						<?php foreach($this->variables as $variable): ?>
							<option value="<?php echo $variable['name']; ?>"><?php echo $variable['name']; ?></option>
						<?php endforeach; ?>
					<?php endif; ?>
					</select></p>
					<p align="left" style="margin-top:5px;"><textarea cols="27" rows="7" name="payment_content" id="payment_content"></textarea></p>
					<input type="submit" class="submitform" value="{%Apply%}" />
					<div style="clear:both;"></div>
					</form>
					-->
					<!-- end payment button -->

					<!-- comment -->
					<hr class="hrseparate" />
					<h3>{%Comment System%}</h3>
					<form action="javascript:;" onsubmit="insertCommentInContent(this, '<?php echo $this->websiteUrl; ?>');">
						<!--
						<p align="left" style="margin-top:10px;"><span>{%topic:%}</span> <input type="text" style="width:100px;" id="comment_topic" name="comment_topic" value="" /></p>
						 <p align="left" style="margin-top:5px;"><span>{%keyword:%} </span> <input type="text" style="width:100px;" id="comment_keyword" name="comment_keyword" value="" /></p>
						-->
						<p align="left" style="margin-top:5px;"><span>{%count on page:%} </span> <input type="text" style="width:30px;" id="comment_count" name="comment_count" value="4" onfocus="this.value='';" /><input type="checkbox" checked="checked" style="margin-left:5px;" name="comment_publish" id="comment_publish" /><span> {%publish?%}</span></p>
						<input type="hidden" name="container_name" id="container_name" value="<?php echo $this->containerName; ?>" />
						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
					<!-- end comment -->

					<!-- Form Maker -->
					<hr class="hrseparate" />
					<h3>{%Forms%}</h3>
					<form action="javascript:void(0);" onsubmit="insertForm(this, '<?php echo $this->websiteUrl; ?>');">
						<p align="left" style="margin-top:10px;">
							<span>{%new form:%} </span>
							<input type="text" style="width:100px;" id="formname" name="formname" value="" onkeyup="if(this.value != ''){this.form.forms_list.disabled='disabled';}else{this.form.forms_list.disabled='';}" />
						</p>
						<p align="left" style="margin-top:10px;">
							<span>{%or%}</span>
							<select name="forms_list" id="forms_list" >
								<option value="" selected="selected">{%select form%}</option>
								<?php if(!empty($this->forms) && is_array($this->forms)): ?>
									<?php foreach($this->forms as $form): ?>
								<option value="<?php echo trim($form); ?>"><?php echo trim($form); ?></option>
									<?php endforeach; ?>
								<?php endif; ?>
							</select></p>
						<p style="margin-top:5px;">&nbsp;<input type="checkbox" name="formcaptcha" id="formcaptcha" /><span>  {%use captcha?%}</span></p>
						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
					<!-- End Form Maker -->

					<!-- Search Maker -->
					<hr class="hrseparate" />
					<h3>{%Add Search Engine%}</h3>
					<form action="javascript:void(0);" onsubmit="insertSearch(this, '<?php echo $this->currentPageId;?>','<?php echo htmlspecialchars($this->currentNavigationName);?>');">
						<p align="left" style="margin-top:10px;">
							<span>{%Select search result page:%}</span>
							<select name="pages_list" id="pages_list" >
								<option value="-1" selected="selected">{%this page%}</option>
								<?php if(!empty($this->pages) && is_array($this->pages)): ?>
									<?php foreach($this->pages as $key=>$page): ?>
								<option value="<?php echo $key; ?>"><?php echo trim($page); ?></option>
									<?php endforeach; ?>
								<?php endif; ?>
							</select></p>
						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
					<!-- End Search Maker -->

					<!-- Swapper -->
					<hr class="hrseparate" />
					<h3>{%Image Rotator%}</h3>
					<form action="javascript:void(0);" onsubmit="insertSwapper(this);">
						<p align="left" style="margin-top:10px;">
							<select name="folder" style="width:120px;">
								<option value="" selected="selected">{%select folder%}</option>
								<?php if(!empty($this->listFolders) && is_array($this->listFolders)): ?>
									<?php foreach($this->listFolders as $folderName): ?>
								<option value="<?php echo trim($folderName); ?>"><?php echo $folderName; ?></option>
									<?php endforeach; ?>
								<?php endif; ?>
							</select></p>						
							<p style="margin:5px 0px 6px 1px;">
							<span style="margin-right:3px;">{%max width:%}</span>
							<input type="text" id="imgWidth" name="imgWidth" style="width:35px;" onchange="setHeight();" />
							<span>{%px%}</span>&nbsp;
							</p>
							<p>
								<span>{%max height:%}</span>
								<input type="text" id="imgHeight" name="imgHeight" style="width:35px;" />
								<span>{%px%}</span>
							</p>
						<p style="margin:5px 0px 6px 1px;">
							<input type="checkbox" name="slideshow">
							<span>{%slide show?%}</span>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<span>{%time:%} </span>
							<input type="text" name="time" style="width:35px;" />
							<span>{%sec%}</span>
						</p>
						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
					<!-- End Swapper -->
                    
					<!-- External RSS -->
					<hr class="hrseparate" />
					<h3>{%External RSS%}</h3>
					<form action="javascript:;" onsubmit="insertExternalRSS(this);">
						<p align="left" style="padding:5px 0px 5px 0px;">
							<span style="margin-right:0px;">{%url:%}</span>
							<input type="text" style="width:180px;" name="url" id="url" value="" onfocus="this.select();" />
						</p>

						<p align="left" style="padding:5px 0px 5px 0px;">
							<span style="margin-right:39px;">{%max result:%}</span>
							<input type="text" style="width:40px;" name="max_result" id="max_result" value="4" onfocus="this.select();" />
						</p>

						<p align="left" style="padding:5px 0px 5px 0px;">
							<span style="margin-right:5px;">{%max characters:%}</span>
							<input type="text" style="width:40px;" name="max_characters" id="max_characters" value="" onfocus="this.select();" />
						</p>

						<input type="submit" class="submitform" value="{%Apply%}" />
						<div style="clear:both;"></div>
					</form>
					<!-- External RSS -->
                    
					<!-- Pageslist -->
					<!--  <hr class="hrseparate" />
					  <h3>{%Pages list%}</h3>
					  <form action="javascript:void(0);" onsubmit="insertPagesList(this);">
					  <p align="left" style="margin-top:10px;">
					  <select name="categories">
						  <option value="" selected="selected">{%select category%}</option>
					<?php //if(!empty($this->listCategories) && is_array($this->listCategories)): ?>
					<?php //foreach($this->listCategories as $categoryName): ?>
							  <option value="<?php //echo trim($categoryName); ?>"><?php //echo $categoryName; ?></option>
					<?php //endforeach; ?>
					<?php //endif; ?>
					  </select></p>
					  <p align="left" style="margin-top:5px;"><input type="checkbox" name="pagesWithImage"> <span>{%with iamge?%}</span></p>
					  <input type="submit" class="submitform" value="{%Apply%}" />
					  <div style="clear:both;"></div>
					  </form> -->
					<!-- End Pageslist -->

                    <!-- Posts The Blog -->
                    <hr class="hrseparate" />
                    <h3>{%Create Blog Post List%}</h3>
                    <form action="javascript:void(0);" id="form-blog-posts" onsubmit="insertBlogVariable();">
                        <p align="left" style="padding:5px 0px 5px 0px;">
                            <span style="margin-right:0px;">{%sort by%}: <input type="radio" name="sortposts" value="date" checked="checked"> date /
                                <input type="radio" name="sortposts" value="author"> author</span>
						</p>
                        <p align="left" style="padding:5px 0px 5px 0px;"><span>{%between%}: </span>
                            <?php $months = array(0=>' ',1=>'January',2=>'February',3=>'March',4=>'April',5=>'May',6=>'June',7=>'July',8=>'August',9=>'September',10=>'October',11=>'November',12=>'December'); ?>
                            <span style="margin-left:2px;">from</span>
                            <input type="text" id="blog-posts-from-date" style="width:80px;color:#7c7c7c;font-weight:bold;background-color:yellow;cursor:pointer;">
                            <!-- <select id="month1" style="width:100px;">
                                <?php foreach ($months as $k1 => $m1): ?>
                                <option value="<?php echo $k1; ?>"><?php echo $m1; ?></option>
                                <?php endforeach; ?>
                            </select> -->
                        </p>
                        <p align="right" style="margin-right:30px;">
                            <span>to</span>
                            <input type="text" id="blog-posts-to-date" style="width:80px;color:#7c7c7c;font-weight:bold;background-color:yellow;cursor:pointer;">
                            <!-- <select id="month2" style="width:100px;">
                                <?php foreach ($months as $k2 => $m2): ?>
                                <option value="<?php echo $k2; ?>"><?php echo $m2; ?></option>
                                <?php endforeach; ?>
                            </select>-->
                        </p>
                        <p align="left" style="padding:5px 0px 5px 0px;"><span>{%author%}:</span> &nbsp;
                            <select id="author">
                            <option value="0"> </option>
                            <?php if (is_array($this->users) && count($this->users) > 0): ?>
                            <?php foreach ($this->users as $user): ?>
                                <option value="<?php echo $user['id']; ?>"><?php echo $user['nickname']; ?></option>
                            <?php endforeach; ?>
                            <?php endif; ?>
                            </select>
                        </p>
                        <p align="left">
                            <span>{%max%}</span> <input type="text" style="width:40px;" id="max-characters" name="max-characters" maxlength="4" value="" /> <span>{%characters%}</span>
                        </p>
                        <input type="hidden" name="pageID" id="pageID" value="<?php echo $this->currentPageId; ?>" />
                        <input type="submit" class="submitform" value="{%Apply%}" />
                    <div style="clear:both;"></div>
                    </form>
                    <!-- End Posts The Blog -->
				</div>
				<!-- end widgets maker -->
				<!-- upload things -->
				<div id="upload_things_button" class="button" onclick="tb_show('','<?php echo $this->websiteUrl; ?>sys/backend_things/uploadthings/?TB_iframe=true&height=580&width=600');">{%Upload Things%}</div>
				<!-- end upload things -->
			</div></div></div>
	<!-- list folders -->
	<select name="adminselectimgfolder" id="adminselectimgfolder" onchange="loadImages('<?php echo $this->websiteUrl; ?>',this.value);">
		<option value="" selected="selected">{%select folder%}</option>
		<?php if(!empty($this->listFolders) && is_array($this->listFolders)): ?>
			<?php foreach($this->listFolders as $folderName): ?>
		<option value="<?php echo $folderName; ?>"><?php echo $folderName; ?></option>
			<?php endforeach; ?>
		<?php endif; ?>
	</select>
	<input type="hidden" id="hid-main-wsurl" name="hid-main-wsurl" value="<?php echo $this->websiteUrl; ?>" />
	<!-- end list folders -->
	<!-- end right toolbar -->
	<a id="toogletinymce" href="javascript:void(0);" onclick="toggleEditor('admincontentarea');">{%No Editor%}</a>
    <span class="textthisblog"><input type="checkbox" id="applyblog" name="applyblog" /> {%Blog This%}</span>

    <div class="tabtools" id="tabtools"><span title="show content" style="border-right:2px solid #7c7c7c;" class="active">{%Content%}</span><span id="show-shopping-for-content" title="show shopping">{%Shopping%}</span></div>
    <div class="tabshopping" id="tabshopping">
        <div class="shoppingcategories">
            <p class="title">{%Categories%}</p>
            <div class="data" id="shoppinggroups" style="height:80px;"></div>
            <p class="title">{%Brands%}</p>
            <div class="data" id="shoppingbrands" style="height:60px;"></div>
            <p align="right"><span class="order"> <input type="checkbox" title="order by brand" id="order-brand" onclick="Sc.addOrder(this);" /> {%brand%} <input type="checkbox" title="order by name" id="order-name" onclick="Sc.addOrder(this);" /> {%name%} <input type="checkbox" title="order by price" id="order-price" onclick="Sc.addOrder(this);" /> {%price%} </span>
                <span class="apply" onclick="Sc.addVariableProductCategory();">{%Create list%}</span></p>
        </div>
        <div class="shoppingseparate"><p>{%Per Product%}</p></div>
        <div class="shoppingproducts" id="shoppingproducts"></div>
    </div>
   
</div>
